//
//  UIScrollView+FCTouch.m
//  辅城
//
//  Created by WJC on 2018/1/27.
//  Copyright © 2018年 吴 剑川. All rights reserved.
//

#import "UIScrollView+FCTouch.h"

@implementation UIScrollView (FCTouch)
//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
//{
//        // 选其一即可
//    [super touchesBegan:touches withEvent:event];
//    [super endEditing:YES];
//        //    [[self nextResponder] touchesBegan:touches withEvent:event];
//}
#pragma  mark -- 手势代理,解决scrollview和手势的冲突
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    
    return YES;//返回yes不阻断手势,返回NO阻断手势,根据具体情况处理
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
    
//此处的otherGesture是指scrollview或者其子类上边自带的手势,再根据具体的需求,我此处是要tableview在不边界回弹的情况下下拉改变整个view的frame
//    if ([otherGestureRecognizer.view isKindOfClass:[UITableView class]] && self.tableview.contentOffset.y > 0) {
//        
//        return NO;
//    }
    
    return YES;
}
@end
